package com.moyu.shopapp.controller;

import com.moyu.shopapp.entity.Banner;
import com.moyu.shopapp.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/banner")
public class BannerController {

    @Autowired
    private BannerService bannerService;

    /**
     * 获取轮播图
     * @return
     */
    @GetMapping("/findBanner")
    public List<Banner> findBanner(){
        return bannerService.list();
    }
}
